package com.xiaoze.question.enums;

import lombok.Getter;

public class ScenarioTacticsConstants {
    public enum BusTypeEnum {
        COMMON("普通（只参与一次该问卷）", "1", "common"),
        DAY("按天数参与（多少天参与一次）", "2", "day"),
        MONTH("按月数参与（几个月参与一次）", "3", "month"),
        IMMOBILIZATION("固定参与（每个月几号固定参与一次）", "4", "immobilization");

        @Getter
        private final String des;
        @Getter
        private final String index;
        @Getter
        private final String code;

        BusTypeEnum(String des, String index, String code) {
            this.des = des;
            this.index = index;
            this.code = code;
        }
        /**
        * 方法描述: 根据 策略编号 获取 策略工厂服务名
        * @Author 胡昊泽 
        * @Date 2024/8/12 9:38
          * @param index: 
        * @return java.lang.String
        */ 
        public static String getCode(String index) {
            for (BusTypeEnum c : BusTypeEnum.values()) {
                if (c.getIndex().equals(index)) {
                    return c.code;
                }
            }
            throw new RuntimeException("没有可匹配的枚举类型");
        }
    }
}